<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/echarts.min.js"></script>
</head>

<body>
    <div id="main" style="width: 900px;height:600px;"></div>

    <script>
        var myChart = echarts.init(document.getElementById('main'));
        var option = {
            title: {
                show:true,  //是否显示
                text: 'ECharts 入门实例', //主标题
                subtext:'好好学习',  //副标题
                right:150,   //数字就像像素值
                borderColor:'red',  //边框颜色
                borderWidth:5,   //边框宽度
                textStyle:{
                    fontSize:20
                }
            },
            toolbox: {
                show: true, //显示
                feature: {
                    saveAsImage: {  //下载为图片
                        show: true
                    },
                    dataView:{     //数据视图
                        show:true
                    },
                    restore:{     //还原
                        show:true
                    },
                    dataZOOM:{    //切换为折线图
                        show:true
                    },
                    magicType:{    //切换为柱状图
                        type:['line','bar']
                    }

                }
            },
            tooltip:{  //弹窗
                trigger:'axis'
            },
            legend: {
                data: ['销量']
            },
            xAxis: {
                data: ['衬衫', '羊毛衫', '雪纺裤', '裤子', '高跟鞋', '袜子']
            },
            yAxis: {},
            series: [{
                name: '销量',
                type: 'bar',
                data: [5, 20, 36, 10, 10, 20]
            }, {
                name: '产量',
                type: 'line',
                data: [7, 30, 50, 22, 40, 80],
                markPoint:{
                    data:[
                        {type:'max',name:'最大值'},
                        {type:'min',name:'最小值',symbol:"arrow"}
                    ]
                },
                markLine:{
                    data:[
                        {type:'average',name:'平均值'}
                    ]
                }
            }]
        };
        //使用刚制定的配置项和数据显示图表
        myChart.setOption(option);
    </script>

</body>

</html>